/*
 * server.cpp
 *
 *  Created on: Mar 14, 2013
 *      Author: Xi
 */

#include "Server.h"
#include <iostream>
#include "TCPSocket.h"
#include "ApplicationLayer.h"
#include "DataLinkLayer.h"
#include"Client.h"
#include"stdlib.h"
#include<vector>

using namespace std;

int main(int argc, char **argv) {

    Server s;

    ApplicationLayer a;
    a.setCarrier("server");
    if(argc != 2)
	{
		cout << "Usage: ./Server [Error Rate]" << endl;
		return 0;
	}
    char *errorStr = argv[1];
    int errorInt = atoi(errorStr);
//    int errorInt = argv[1];
    DataLinkLayer dl;
    dl.setErrorRate(errorInt);
    TCPSocket *soc = new TCPSocket();
    bool test = soc->setUp(12111);

    soc->listenConnection();
}

Server::Server() {
}

Server::~Server() {
    // TODO Auto-generated destructor stub
}

